package com.msb.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/stock")
public class StockController {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/list")
    public String list(){
//        String forObject = restTemplate.getForObject("http://localhost:8081/order/save", String.class);
        try {
            Thread.sleep(6000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return "查询成功！order+";
    }

    @GetMapping("/save")
    public String save(){
        return "查询成功！saveOrder";
    }
}
